package dto

import (
	"invitation/internal/http/utils"
	"strings"
)

type GamePayload struct {
	ID                string `json:"id"`
	Name              string `json:"name" `
	Desc              string `json:"desc" `
	ProblemToSolve    string `json:"problem_to_solve" `
	Introduction      string `json:"introduction"`
	TheoryExplanation string `json:"theory_explanation" `
}

func (gp *GamePayload) Sanitize() {
	gp.Name = strings.TrimSpace(gp.Name)
	gp.Desc = utils.CleanWhitespace(gp.Desc)
	gp.ProblemToSolve = utils.CleanWhitespace(gp.ProblemToSolve)
	gp.Introduction = utils.CleanWhitespace(gp.Introduction)
	gp.TheoryExplanation = utils.CleanWhitespace(gp.TheoryExplanation)
}
